//
//  ViewController.m
//  UIButtonMutablieClick
//
//  Created by andson-zhw on 16/8/3.
//  Copyright © 2016年 andson. All rights reserved.
//

#import "ViewController.h"
#import "UIControl+ZHW.h"
#import "twoViewController.h"

#define SuiJiYanSe [UIColor colorWithRed:arc4random()%256/255.0 green:arc4random()%256/255.0 blue:arc4random()%256/255.0 alpha:1]
#define selfPingMuWidth [UIScreen mainScreen].bounds.size.width
#define selfPingMuHeight [UIScreen mainScreen].bounds.size.height

@interface ViewController ()

@property (nonatomic, strong)UIButton *button;

@property (nonatomic, assign)NSInteger aa;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    _aa = 0;
    
    self.button = [UIButton buttonWithType:UIButtonTypeCustom];
    
    self.button.backgroundColor = [UIColor redColor];
    
    self.button.frame = CGRectMake(100, 200, 200, 50);
    
    [self.button setTitle:@"下一页" forState:UIControlStateNormal];
    
    [self.button addTarget:self action:@selector(ButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:self.button];

    
    self.button.zhw_ignoreEvent = NO;
    self.button.zhw_acceptEventInterval = 3.0;
}

- (void)ButtonAction:(UIButton *)btn{
    
    _aa++;
    
    NSLog(@"    %ld",(long)_aa);
    
//    twoViewController *two  = [[twoViewController alloc]init];
//    
//    [self.navigationController pushViewController:two animated:YES];
}

//- (IBAction)runtimeAction:(UIButton *)sender {
//    NSLog(@"----run click");
//    [UIView animateWithDuration:3 animations:^{
//        
//        self.colorView.center = CGPointMake(200, 500);
//        
//    } completion:^(BOOL finished) {
//        
//        self.colorView.center = CGPointMake(95, 85);
//        
//    }];
//}
//- (IBAction)buttonAction:(UIButton *)sender {
//    NSLog(@"------comm click");
//    [UIView animateWithDuration:3 animations:^{
//        
//        self.colorView.center = CGPointMake(200, 500);
//        
//    } completion:^(BOOL finished) {
//        
//        self.colorView.center = CGPointMake(95, 85);
//        
//    }];
//}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
